package com.spring.hotel.controller;

import com.spring.hotel.common.JsonResponse;
import com.spring.hotel.common.utils.SecurityUtils;
import com.spring.hotel.entity.UserInfoDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/auth")
public class AuthController {

    @GetMapping("/userInfo")
    public JsonResponse<UserInfoDTO> getUserInfo(){
        return JsonResponse.success(SecurityUtils.getUserInfo());
    }
}
